tools/libs/gnttab: Fix PAGE_SIZE redefinition error
authorCostin Lupu <costin.lupu@cs.pub.ro>
Tue, 8 Jun 2021 12:35:28 +0000 (15:35 +0300)
committerJulien Grall <jgrall@amazon.com>
Fri, 9 Jul 2021 15:00:05 +0000 (16:00 +0100)
commitd1b32abd94b620db05dfff0f4ce9cc17b9da0ccf
tree2cb987908c1c83247fae9643769988552918563f
parent0dbb4be739c50b8018aeeb285ef290bf7962a28e
tools/libs/gnttab: Fix PAGE_SIZE redefinition error

If PAGE_SIZE is already defined in the system (e.g. in /usr/include/limits.h
header) then gcc will trigger a redefinition error because of -Werror. This
patch replaces usage of PAGE_* macros with XC_PAGE_* macros in order to avoid
confusion between control domain page granularity (PAGE_* definitions) and
guest domain page granularity.

The exception is in osdep_xenforeignmemory_map() where we need the system page
size to check whether the PFN array should be allocated with mmap() or with
dynamic allocation.

Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Julien Grall <jgrall@amazon.com>
Acked-by: Ian Jackson <iwj@xenproject.org>
tools/libs/gnttab/freebsd.c
tools/libs/gnttab/linux.c
tools/libs/gnttab/netbsd.c